Repository navigation
fix: ignore nested kind attribute in multi-kind context conversion - #72
Merged
Merged
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
There was a problem hiding this comment.
Risk: low.
Automated risk review (dry run): Low
This PR would be automatically approved.
Why: Narrow skip of nested kind in EvaluationContextConverter for multi-kind contexts, with matching tests in ContextConverterTest. Cursor Bugbot completed with no findings.
If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.
Sent by Cursor Approval Agent: Dry-Run PR Approver
joker23
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Requirements
Related issues
Same fix as launchdarkly/openfeature-php-server#39; the Python provider already behaves this way.
Describe the solution you've provided
In a multi-kind evaluation context, the sub-context's kind comes from its top-level attribute name (OFP Req 2.2.1 / 2.4.1).
EvaluationContextConverterskipped onlykey/targetingKeywhen copying a sub-context's attributes, so a nestedkind(e.g.org: { kind: "user", key: ... }) overwrote the sub-context's kind and could produce an invalid context. The converter now also skipskindthere.Tests cover a nested
kindequal to another kind ("user"),kind: "multi", and a non-stringkind(42). Each one checks that the result is a valid two-kind context, that theorgsub-context keeps kindorg, and thatkindis not a custom attribute. The existing single-context kind tests pass unchanged.Describe alternatives you've considered
Logging a warning for a nested
kind. Not done, to match the PHP and Python providers.Additional context
./gradlew buildandjacocoTestReportpass locally (66 tests).Implemented in session Ignore nested kind in Java multi-context conversion
Review with Devin · Open in Devin Desktop
Note
Overview
Fixes multi-kind OpenFeature → LaunchDarkly conversion when a sub-context (e.g.
org) incorrectly includes a nestedkindattribute alongsidekey.EvaluationContextConverter.BuildSingleContextalready ignoredkeyandtargetingKeywhen copying attributes; it now also skipskind, since sub-context kind is defined by the top-level attribute name in akind: multicontext. That prevents a nestedkind(wrong string,"multi", or non-string) from corrupting the builtLDContextor landing in custom attributes.A new test
itIgnoresNestedKindInMultiKindContextschecks string and non-string nestedkindvalues and asserts a valid two-kind result withorgstaying kindorgand nokindcustom attribute, with no error logs.Reviewed by Cursor Bugbot for commit 0a428fe. Bugbot is set up for automated code reviews on this repo. Configure here.